<template>
    <div class="recommend">
      <div class="title">热销推荐</div>
      <ul>

          <router-link class="item" v-for="item of recommendList" :key="item.id" tag="li" :to="'/detail/'+item.id">
            <img :src="item.imgUrl" alt="">
            <div class="item-text">
              <p class="item-name">{{item.title}}</p>
              <p class="item-desc">{{item.desc}}</p>
              <button>查看详情</button>
            </div>
          </router-link>

      </ul>
    </div>
</template>
<script>
export default {
  name: 'HomeRecommend',
  props: {
    recommendList: Array
  },
  data () {
    return {}
  }
}
</script>
<style scoped lang="stylus">
  @import "~styles/mixins.styl";
  .recommend
    background:#eee
  .title
    line-height: .6rem
    background: #eee
    margin-top: .1rem
    padding-left:.08rem
  .item
    background: #fff
    overflow: hidden
    display: flex
    margin-bottom:.02rem
    img
      height:2rem
      padding:.2rem
    .item-text
      flex:1
      min-width: 0
      .item-name
        line-height:.94rem
        font-size:.32rem
        ellipsis()
      .item-desc
        line-height:.4rem
        color:#ccc
        ellipsis()
      button
        background:#E3760F
        color:#fff
        padding:0 .2rem
        border-radius:.06rem
        line-height:0.5rem
        margin-top: 0.4rem
        font-size:.26rem
</style>
